From fe66cac6cb4336852850ec374d156c37bc503ab9 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 3 Jan 2006 15:45:36 +0000 Subject: [PATCH] * Bug 4456: Add hook for marking article patrolled --- RELEASE-NOTES | 1 + docs/hooks.txt | 12 ++++++++++++ includes/Article.php | 10 ++++++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 845a0ef7e8..e0311cd61b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -398,6 +398,7 @@ fully support the editing toolbar, but was found to be too confusing. * Removed broken wgAllowAnonymousMinor and added new group right minoredit * (bug 4457) Update for Portuguese language (pt) * convertPlural breakage fixed a little +* Bug 4456: Add hook for marking article patrolled === Caveats === diff --git a/docs/hooks.txt b/docs/hooks.txt index 028d8faac0..ae05905981 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -332,6 +332,18 @@ $typeText: array of strings 'LogPageLogHeader': strings used by wfMsg as a header. $headerText: array of strings +'MarkPatrolled': before an edit is marked patrolled +$rcid: ID of the revision to be marked patrolled +$user: the user (object) marking the revision as patrolled +$wcOnlySysopsCanPatrol: config setting indicating whether the user + needs to be a sysop in order to mark an edit patrolled + +'MarkPatrolledComplete': after an edit is marked patrolled +$rcid: ID of the revision marked as patrolled +$user: user (object) who marked the edit patrolled +$wcOnlySysopsCanPatrol: config setting indicating whether the user + must be a sysop to patrol the edit + 'PageRenderingHash': alter the parser cache option hash key A parser extension which depends on user options should install this hook and append its values to the key. diff --git a/includes/Article.php b/includes/Article.php index 640a510a96..6530045999 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1499,10 +1499,12 @@ class Article { $rcid = $wgRequest->getVal( 'rcid' ); if ( !is_null ( $rcid ) ) { - RecentChange::markPatrolled( $rcid ); - $wgOut->setPagetitle( wfMsg( 'markedaspatrolled' ) ); - $wgOut->addWikiText( wfMsg( 'markedaspatrolledtext' ) ); - + if( wfRunHooks( 'MarkPatrolled', array( &$rcid, &$wgUser, $wgOnlySysopsCanPatrol ) ) ) { + RecentChange::markPatrolled( $rcid ); + wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, $wgOnlySysopsCanPatrol ) ); + $wgOut->setPagetitle( wfMsg( 'markedaspatrolled' ) ); + $wgOut->addWikiText( wfMsg( 'markedaspatrolledtext' ) ); + } $rcTitle = Title::makeTitle( NS_SPECIAL, 'Recentchanges' ); $wgOut->returnToMain( false, $rcTitle->getPrefixedText() ); } -- 2.20.1